import { uuid } from 'vue-uuid';
//生成一个随机字符串，每次执行不会变化，游客身份持久储存
export const getUUID = ()=>{
    //从本地储存获取uuid
    let uuid_token = localStorage.getItem('UUIDTOKEN');
    if(!uuid_token){
        //生成游客临时身份
        uuid_token = uuid.v4();
        //本地储存
        localStorage.setItem('UUIDTOKEN',uuid_token);
    }
    //没有返回值undefined
    return uuid_token;
}